<!-- /* Description for file.
 * 单个简历录入
 * @copyright     Copyright 2008-2010, PHInfo Services Inc. (http://www.phinfoservices.com)
 * @package       ues
 * @subpackage    ues/app/views/resources
 * @since         ues
 * @version       V0.0.1
 * @modifiedby   会兵2011年0709
 * @lastmodified  会兵2011年0709
 */
 -->

<?php
echo $html->css ( 'style' );
echo $html->css ( 'tab' );
echo $javascript->link ( 'jquery' );
?>
<script type="text/javascript">
//行业二级菜单
$(document).ready(function(){
	$("#ResumeIndustry1").change(function(){
		var IndustryDroptoplist = $(this).val();
		if(IndustryDroptoplist!="")
		{
			$("#ResumeIndustry").val($("#ResumeIndustry1 option:selected").text() + "_");
			$.post("<?php echo ROOT_WEB_PATH; ?>/industries/industriesQuery/",{
				Industry : $(this).val()
				},
			function(data,textStatus){
					 $("#ResumeIndustry2:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					//	 alert($(this).attr("name"));
					 $("#ResumeIndustry2:eq(0)").append("<option></option>");
					 $("#ResumeIndustry2:eq(0)>option:last").val($(this).attr("name")).html($(this).text());
				  });
				});
		}
		else
		{
			$("#ResumeIndustry2:eq(0)>option").remove();
			$("#ResumeIndustry2:eq(0)").append("<option></option>");
			$("#ResumeIndustry2:eq(0)>option:last").val("").html("不选");
			$("#ResumeIndustry").val("");
		}
	});
	$("#ResumeIndustry2").change(function(){
		var IndustryDroptoplist = $(this).val();
		if(IndustryDroptoplist!="")
		{
			$("#ResumeIndustry").val($("#ResumeIndustry1 option:selected").text() + "_" + $("#ResumeIndustry2 option:selected").text());
		}
		else
		{
			$("#ResumeIndustry").val($("#ResumeIndustry1 option:selected").text() + "_");
		}
	});
	
	$("#ResumeCompany1").change(function(){	
		var companyval = $(this).val();
		if(companyval!="")
		{
			$("#ResumeCompany").val($("#ResumeCompany1 option:selected").text() + "_");
		}
	});
	
	$("#company_search").click(function(){
		var rcv = $("#ResumeCompanykey").val();
		$("#ResumeCompany1 option").each(function() {
			if($(this).val().indexOf(rcv) == -1 && $(this).text() != '不选') {
				$(this).css("display","none");
			}
		});	
	});
	
	
});

//职位二级菜单
$(document).ready(function(){
	$("#ResumePosition1").change(function(){
		var IndustryDroptoplist = $(this).val();
		if(IndustryDroptoplist!="")
		{
			$("#ResumePosition").val($("#ResumePosition1 option:selected").text() + "_");
			$.post("<?php echo ROOT_WEB_PATH; ?>/positions/getPosition/",{
				Position : $(this).val()
				},
			function(data,textStatus){
					 $("#ResumePosition2:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					//	 alert($(this).attr("name"));
					 $("#ResumePosition2:eq(0)").append("<option></option>");
					 $("#ResumePosition2:eq(0)>option:last").val($(this).attr("name")).html($(this).text());
				  });
				});
		}
		else
		{
			$("#ResumePosition2:eq(0)>option").remove();
			$("#ResumePosition2:eq(0)").append("<option></option>");
			$("#ResumePosition2:eq(0)>option:last").val("").html("不选");
			$("#ResumePosition").val("");
		}
	});
	$("#ResumePosition2").change(function(){
		var IndustryDroptoplist = $(this).val();
		if(IndustryDroptoplist!="")
		{
			$("#ResumePosition").val($("#ResumePosition1 option:selected").text() + "_" + $("#ResumePosition2 option:selected").text());
		}
		else
		{
			$("#ResumePosition").val($("#ResumePosition1 option:selected").text() + "_");
		}
	});
});

//职能二级菜单
$(document).ready(function(){
	$("#ResumeCompetency1").change(function(){
		var CompetencyDroptoplist = $(this).val();
		if(CompetencyDroptoplist!="")
		{
			$("#ResumeCompetency").val($("#ResumeCompetency1 option:selected").text() + "_");
			$.post("<?php echo ROOT_WEB_PATH; ?>/competencies/getcompetencies/",{
				Competency : $(this).val()
				},function(data,textStatus){
					 $("#ResumeCompetency2:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					 $("#ResumeCompetency2:eq(0)").append("<option></option>");
					 $("#ResumeCompetency2:eq(0)>option:last").val($(this).attr("name")).html($(this).text());
					 $("#ResumeCompetency3:eq(0)>option").remove();
					 $("#ResumeCompetency3:eq(0)").append("<option></option>");
					 $("#ResumeCompetency3:eq(0)>option:last").val("").html("不选");
				  });
				});
		}
		else
		{
			$("#ResumeCompetency2:eq(0)>option").remove();
			$("#ResumeCompetency2:eq(0)").append("<option></option>");
			$("#ResumeCompetency2:eq(0)>option:last").val("").html("不选");
			$("#ResumeCompetency3:eq(0)>option").remove();
			$("#ResumeCompetency3:eq(0)").append("<option></option>");
			$("#ResumeCompetency3:eq(0)>option:last").val("").html("不选");
			$("#ResumeCompetency").val("");
		}
	});
});

//职能三层字段 级联菜单 //
$(document).ready(function(){
	$("#ResumeCompetency2").change(function(){
		var list = $(this).val();
		if(list!="")
		{
			$("#ResumeCompetency").val($("#ResumeCompetency1 option:selected").text() + "_" + $("#ResumeCompetency2 option:selected").text() + "_");
			$.post("<?php echo ROOT_WEB_PATH; ?>/competencies/getcompetencies/",{
				Competency : $(this).val()
				},function(data,textStatus){
					 $("#ResumeCompetency3:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					//	 alert($(this).attr("name"));
					 $("#ResumeCompetency3:eq(0)").append("<option></option>");
					 $("#ResumeCompetency3:eq(0)>option:last").val($(this).attr("name")).html($(this).text());					 
				  });
				});
		}
		else
		{
			$("#ResumeCompetency3:eq(0)>option").remove();
			$("#ResumeCompetency3:eq(0)").append("<option></option>");
			$("#ResumeCompetency3:eq(0)>option:last").val("").html("不选");
			$("#ResumeCompetency").val($("#ResumeCompetency1 option:selected").text() + "_");
		}
	});
	$("#ResumeCompetency3").change(function(){
		var list = $(this).val();
		if(list!="")
		{
			if($("#ResumeCompetency1 option:selected").text()!="不选"&&$("#ResumeCompetency1 option:selected").text()!="不限")
			$("#ResumeCompetency").val($("#ResumeCompetency1 option:selected").text() + "_" + $("#ResumeCompetency2 option:selected").text() + "_" + $("#ResumeCompetency3 option:selected").text());
			else
			$("#ResumeCompetency").val("");
		}
		else
		{
			if($("#ResumeCompetency1 option:selected").text()!="不选"&&$("#ResumeCompetency1 option:selected").text()!="不限")
			$("#ResumeCompetency").val($("#ResumeCompetency1 option:selected").text() + "_" + $("#ResumeCompetency2 option:selected").text() + "_");
			else
			$("#ResumeCompetency").val("");
		}
	});
});

//职位二级菜单
$(document).ready(function(){
	$("#ResumeChanneltype").change(function(){
		var IndustryDroptoplist = $(this).val();
		if(IndustryDroptoplist!="")
		{
			$.post("<?php echo ROOT_WEB_PATH; ?>/channelmanages/getchannelmanage/",{
				Channelmanage : $(this).val()
				},
			function(data,textStatus){
					 $("#ResumeChannelmanage:eq(0)>option").remove();
					 $(data).find("aaa").each(function(){
					//	 alert($(this).attr("name"));
					 $("#ResumeChannelmanage:eq(0)").append("<option></option>");
					 $("#ResumeChannelmanage:eq(0)>option:last").val($(this).attr("name")).html($(this).text());
				  });
				});
		}
		else
		{
			$("#ResumeChannelmanage:eq(0)>option").remove();
			$("#ResumeChannelmanage:eq(0)").append("<option></option>");
			$("#ResumeChannelmanage:eq(0)>option:last").val("").html("不选");
		}
	});
});


$(function()
{
	$("#fieldset").click(function(){
		getset();
		var text = $("#setparam").val();
		window_location_href('<?php echo ROOT_WEB_PATH; ?>/resumes/resumeneedset/' + text);
	});
});

function getset()
{
	var delArr = $(":checkbox:checked");
	var str = "";
	for(var i=0;i<delArr.length;i++) {
		var del = delArr[i].value;
		str += del;
		str += ",";
	}
	$("#setparam").val(str);
}

</script>

<!-- 当前位置-->
<div id="tabmenubar">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td class="tabmenubartitle1"><?php echo  __('YourPosition');//您现在的位置：?></td>
		<td class="tabmenubartitle2"><?php echo __('Resumesmanagements');//一级目录
										   echo '>';?>
									<?php echo $html->tag('span', __('Resume insertOne',true));//当前操作地用span加粗?> 						  
		</td>
	</tr>
</table>
</div>
<!-- 当前位置-->

<?php echo $form->create('Resume',array('action'=>'insertoneadd','type'=> 'post'));?>

<div class="tabflex" style="font-size:12px;">
<fieldset><legend>预先干预字段</legend>
<table width="100%" cellspacing="0" cellpadding="0" border="0"
	style="text-align: left">
	<tr>
		<td width="50"></td>
		<td width="100">设置必填字段：</td>
		<td>
				<?php 
					echo $form->checkbox('industry11',array('value'=>'industry','checked'=>$fieldindus));
				?>
				<?php echo __('resumesindustry');?>
		</td>
		<td>
			<?php 
					echo $form->checkbox('competency11',array('value'=>'competency','checked'=>$fieldcompent));
				?>
				<?php echo __('recruitpositionsspecification');?>
		</td>
		<td>
			<?php 
					echo $form->checkbox('position11',array('value'=>'position','checked'=>$fieldposit));
				?>
				<?php echo __('linkmenposition');?>
		</td>
		<td>
			<?php 
					echo $form->button('设置',array('class'=>'btn2','id'=>'fieldset'));
				?>
		</td>
		<td>
			<?php 
					echo $form->hidden('setparam',array('id'=>'setparam'));
				?>
		</td>
		</div>
	</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0" border="0"
	style="text-align: left">
	<tr>
		<td width="50"></td>
		<td width="100"><?php __('Resume resumefrom');//简历来源：?>:</td>
		<td >
		<?php $options = array('' =>'其他','智联'=>'智联','中华英才'=>'中华英才','上海招聘网'=>'上海招聘网','上海招聘热线'=>'上海招聘热线','第一招聘网'=>'第一招聘网','晨报招聘'=>'晨报招聘','精英招聘'=>'精英招聘','前程无忧'=>'前程无忧','中华英才（新）'=>'中华英才（新）');
					echo $form->input('resumefrom',array('options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1'));		
				?>
		</td>
	</tr>
	<tr>
		<td width="50"></td>
		<td width="100"><?php __('Resumeranks');//简历等级：?>:</td>
		<td >
		<?php $options = array();
					foreach($resumeranklist as $eachrecord)
					{
						$options[$eachrecord['Resumerank']['name']] = $eachrecord['Resumerank']['name'];
					}
					echo $form->input('resumerank',array('empty' =>'不选','options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1'));		
				?>
		</td>
	</tr>
	<!--当前行业下拉-->
	<tr>
		<td width="50"></td>
		<td width="100"><?php __('resumesindustry');//行业：?>:</td>
		<td >
		<?php
		echo $form->text('industry',array('class'=>'TextBoxE1')).'&nbsp;&nbsp;';
		
		 $options = array();
					foreach($industrylist as $eachrecord)
					{
						$options[$eachrecord['Industry']['id']] = $eachrecord['Industry']['name'];
					}
					echo $form->input('industry1',array('empty' =>'不选','options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1'));		
				?>

		<?php echo $form->input('industry2',array('options'=>array('0'=>'不选'),'label'=>false,'div'=>false,'class'=>'TextBoxE1'));		
				?>
		</td>
		<td >
		<?php 
			
		?>
		</td>
		</tr>
		<tr>
		<td width="50"></td>
		<td width="100"><?php __('recruitpositionsspecification');//职能?>:</td>
		<!--职能下拉-->
		<td >
		<?php
		echo $form->text('competency').'&nbsp;&nbsp;';
		 $options = array();
					foreach($competencylist as $eachrecord)
					{
						$options[$eachrecord['Competency']['id']] = $eachrecord['Competency']['name'];
					}
					echo $form->input('competency1',array('empty' =>'不选','options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1'));		
				?>
		<?php echo $form->input('competency2',array('options'=>array('0'=>'不选'),'label'=>false,'div'=>false,'class'=>'TextBoxE1'));		
				?>

		<?php echo $form->input('competency3',array('options'=>array('0'=>'不选'),'label'=>false,'div'=>false,'class'=>'TextBoxE1'));		
				?>
		</td>
		<td>
		<?php 
			
		?>
		</td>
		</tr>
		
		<tr>
		<td width="50"></td>
		<td width="100"><?php __('linkmenposition');//职位?>:</td>
		<!--现在职位下拉-->
		<td >
		<?php 
		echo $form->text('position').'&nbsp;&nbsp;';
		$options = array();
					foreach($positionlist as $eachrecord)
					{
						$options[$eachrecord['Position']['id']] = $eachrecord['Position']['name'];
					}
					echo $form->input('position1',array('empty' =>'不选','options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1'));		
				?>

		<?php echo $form->input('position2',array('options'=>array('0'=>'不选'),'label'=>false,'div'=>false,'class'=>'TextBoxE1'));		
				?>
		</td>
		<td >
		<?php 
			
		?>
		</td>
		<!--现工作地区下拉-->
		</tr>
		<!--现在公司下拉-->
		<tr>
		<td width="50"></td>
		<td width="100">现任职公司:</td>
		<td >
		<?php
		echo $form->text('company').'&nbsp;&nbsp;';
		 $options = array();
					foreach($companymanagelist as $eachrecord)
					{
						$options[$eachrecord['Companymanage']['name']] = $eachrecord['Companymanage']['name'];
					}
					echo $form->input('company1',array('empty' =>'不选','options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1'));	
					echo '&nbsp;&nbsp;'.$form->text('companykey').'&nbsp;&nbsp;';
					echo $form->button('查',array('id' => 'company_search'));	
				?>
		</td>
		</tr>		
		<tr style="display:none;">
		<td width="50"></td>
		<td width="100"><?php __('Resume Channelmanage');//渠道?>:</td>
		<td >
		<?php $options = array();
					foreach($channeltypelist as $eachrecord)
					{
						$options[$eachrecord['Channeltype']['id']] = $eachrecord['Channeltype']['name'];
					}
					echo $form->input('channeltype',array('empty' =>'不选','options'=>$options,'label'=>false,'div'=>false,'class'=>'TextBoxE1'));		
				?>
		<?php echo $form->input('channelmanage',array('options'=>array('0'=>'不选'),'label'=>false,'div'=>false,'class'=>'TextBoxE1'));		
				?>
		</td>
		<td >				</td>
		</tr>
	
</table>
</fieldset>

<table width="100%" style="text-align: left">
	<tr>
		<td width="50"></td>
		<td ><?php echo $html->link('手工入库', '/resumes/handinsert', array('class'=>'btn4'),null,array('escape'=>false)); ?></td>
		<td ><?php echo $form->button('简历解析',array('type'=>'submit','class'=>'btn4'));?>
		</td>
		<td ><?php echo $form->button('重置',array('type'=>'reset','class'=>'btn2'));?>
		</td>
		<td></td>
	</tr>
	<tr>
		<td COLSPAN="5">
			<?php echo $form->textarea('resumecontent',array('label'=>false,'class'=>'areaStyle txtOut','style'=>'height:800px;width:99%'));		
				?>
		</td>
	</tr>
	<tr>
		<td></td>
		<td COLSPAN="4">
				<font color=gray>请将单个简历内容粘贴到上框中，点击简历入库按钮后即可到“简历分类检索”中查看</font>
		</td>
	</tr>
</table>

<?php echo $form->end();?>
</div>

